package com.cpo.domain;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.Column;
import javax.persistence.GenerationType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.apache.commons.lang.builder.ToStringBuilder;

@Entity
@Table(name="USER_LOGIN")
public class Login {

	private int id;
	private String userName;
	private String password;
	private int noOfAttempts;
	private String status;
	private Date lastFailedDateTime;
	public Login(){
		
	}


	public Login(int id, String userName, String password, int noOfAttempts,
			String status, Date lastFailedDateTime) {
		super();
		this.id = id;
		this.userName = userName;
		this.password = password;
		this.noOfAttempts = noOfAttempts;
		this.status = status;
		this.lastFailedDateTime = lastFailedDateTime;
	}
	
	@Override
	public String toString(){
		return ToStringBuilder.reflectionToString(this);
	}

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="ID")
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}
	@Column(name="USER_NAME")
	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}
	@Column(name="PASSWORD")
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}
	@Column(name="NO_OF_ATTEMPTS")
	public int getNoOfAttempts() {
		return noOfAttempts;
	}

	public void setNoOfAttempts(int noOfAttempts) {
		this.noOfAttempts = noOfAttempts;
	}
	@Column(name="STATUS")
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Column(name="LAST_FAILED_DATE_TIME")
	public Date getLastFailedDateTime() {
		return lastFailedDateTime;
	}


	public void setLastFailedDateTime(Date lastFailedDateTime) {
		this.lastFailedDateTime = lastFailedDateTime;
	}
	
	
}
